Skip to content

Fix promotion workflow to use auto-merge for branch protection#57

Merged
Its-donkey merged 1 commit intotestfrom
fix/promotion-auto-merge
Feb 6, 2026
Merged

Fix promotion workflow to use auto-merge for branch protection#57
Its-donkey merged 1 commit intotestfrom
fix/promotion-auto-merge

Conversation

@Its-donkey
Copy link
Copy Markdown
Owner

Summary

  • Fixes the promotion workflow failing with "base branch policy prohibits the merge" when branch protection requires status checks
  • Uses --auto flag on gh pr merge so the PR merges automatically once checks pass
  • Splits the merge+tag step into two separate steps: enable auto-merge, then poll until merged before creating the release tag

Problem

The auto_merge option ran gh pr merge directly, which fails when branch protection rules require status checks to pass first. The workflow would exit with error code 1.

Fix

  1. Enable auto-merge - gh pr merge --auto --merge returns immediately and queues the merge
  2. Poll for merge - Checks PR state every 15s (up to 10min timeout) until it's MERGED
  3. Create tag - Only after the PR is confirmed merged, fetch the target branch and tag it

Split the merge+tag step into two: enable auto-merge (returns
immediately), then poll until the PR is actually merged before
creating the release tag. Prevents tagging stale content when
required status checks haven't completed yet.
@Its-donkey Its-donkey merged commit 059e42e into test Feb 6, 2026
6 checks passed
@Its-donkey Its-donkey deleted the fix/promotion-auto-merge branch February 6, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant